<?php

namespace App\Validate;

use App\Validate\BaseValidate;

class ResourceTotalCdbtValidate extends  BaseValidate
{
    //验证规则
    protected $rule = [
        'id' => 'bail|required|integer',
        'img' => 'bail|required',
        'type_id' => 'bail|required|integer',
        'chapter_id' => 'bail|required|integer',
        'title' => 'bail|required',
        'content' => 'bail|required',

        'resource_business_id' => 'bail|required|integer',
        'guid' => 'bail|required|size:32',
        'collect_id' => 'bail|required',

    ];
    //自定义验证信息
    protected $message = [
        'id.required' => 'ID不能为空',
        'id.integer' => 'ID格式不正确',
        'img.required' => '图片不能为空',
        'type_id.required' => '类型ID不能为空',
        'type_id.integer' => '类型ID格式不正确',
        'chapter_id.required' => '章节ID不能为空',
        'chapter_id.integer' => '章节ID格式不正确',
        'title.required' => '标题不能为空',
        'content.required' => '内容不能为空',

        'resource_business_id.required' => '资源商ID不能为空',
        'resource_business_id.integer' => '资源商ID格式不正确',
        'guid.required' => 'ID不能为空',
        'guid.size' => 'ID格式不正确',
        'collect_id.required' => '收藏ID不能为空',
    ];


    //自定义场景
    protected $scene = [

        'wx_get_ebook_book_chapter' => ['guid', 'resource_business_id'], //获取电子图书章节


    ];
}
